#include<iostream>
#include<string>

using namespace std;

int monday[13][2] = {
    {0, 0}, {31, 31}, {28, 29}, {31, 31}, {30, 30}, {31, 31}, {30, 30}, {31, 31}, {31, 31},
    {30, 30}, {31, 31}, {30, 30}, {31, 31}
};

bool isLeap(int y) {
    return (y % 4 == 0 && y % 100 != 0) || y % 400 == 0;
}

int main() {
    int d1, d2;
    while (cin >> d1 >> d2) {
        int year1, month1, day1, year2, month2, day2;
        year1 = d1 / 10000;
        month1 = d1 / 100 % 100;
        day1 = d1 % 100;
        year2 = d2 / 10000;
        month2 = d2 / 100 % 100;
        day2 = d2 % 100;
        int sum = 0;
        if (1) {
            while (day1 < day2 || month1 < month2 || year1 < year2) {
                day1++;
                if (day1 == monday[month1][isLeap(year1)] + 1) {
                    day1 = 1;
                    month1++;
                }
                if (month1 == 13) {
                    month1 = 1;
                    year1 ++;
                }
                sum++;
            }
        }

        cout << sum + 1 << endl;
    }
    return 0;
}